{% extends "base.html" %}
{% load static %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4 class="mb-0">用户登录</h4>
                </div>
                <div class="card-body">
                    <form method="post" class="needs-validation" novalidate>
                        {% csrf_token %}
                        
                        {% if form.errors %}
                        <div class="alert alert-danger">
                            用户名或密码错误，请重试。
                        </div>
                        {% endif %}
                        
                        <div class="mb-3">
                            <label for="id_username" class="form-label">工号</label>
                            <input type="text" name="username" class="form-control" id="id_username" required>
                        </div>
                        
                        <div class="mb-3">
                            <label for="id_password" class="form-label">密码</label>
                            <input type="password" name="password" class="form-control" id="id_password" required>
                        </div>
                        
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">登录</button>
                            <a href="{% url 'register' %}" class="btn btn-outline-secondary">注册新账号</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 